using Gateway.IApplication.UploadFiles.Output;
using Gateway.Infrastructure.AutoDI;

namespace Gateway.IApplication.UploadFiles;

/// <summary>
/// 上传文件服务
/// </summary>
public interface IUploadFilesApp : IDependency
{
    /// <summary>
    /// 分片上传
    /// </summary>
    /// <param name="stream"></param>
    /// <param name="fileName"></param>
    /// <param name="uploadId"></param>
    /// <param name="partSize"></param>
    /// <param name="partNumber"></param>
    /// <returns></returns>
    Task<MultipartUploadOutput> PartUploadAsync(Stream stream, string fileName, string uploadId, long partSize,
        int partNumber);

    /// <summary>
    /// 完成分片上传
    /// </summary>
    /// <param name="path"></param>
    /// <param name="uploadId"></param>
    /// <returns></returns>
    Task<string> FinishMultipartUploadAsync(string path, string uploadId);

    /// <summary>
    /// 获取上传状态
    /// </summary>
    /// <param name="keyId"></param>
    /// <returns></returns>
    Task<FinishUploadOutput> GetUploadStatus(string keyId);


    /// <summary>
    /// 上传文件
    /// </summary>
    /// <param name="stream"></param>
    /// <param name="fileName"></param>
    /// <param name="size"></param>
    /// <param name="provider"></param>
    /// <param name="contentType"></param>
    /// <returns></returns>
    Task<FileOutput> UploadFile(Stream stream,string fileName,long size,string provider,string contentType);

    /// <summary>
    /// 上传文件
    /// </summary>
    /// <param name="fileUrl"></param>
    /// <returns></returns>
    Task<FileOutput> UploadFile(string fileUrl);

    /// <summary>
    /// 删除文件（软删除）
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task<bool> Remove(string id);
}